{subtemplate common/header}
<link rel="stylesheet" type="text/css" href="data/cache/style_{STYLEID}_forum_post.css?{VERHASH}">

<style>
.sinf {
	float: left;
	padding-right: 14px;
	width: 560px;
	border-right: 1px dashed #CCC;
}	
.sadd {
float: left;
margin-left: 10px;
width: 320px;
overflow: hidden;
</style>


<div id="pt" class="bm cl">

	<div class="z">
		<a href="./" class="nvhm" title="{lang homepage}">$_G[setting][bbname]</a> <em>&rsaquo;</em>
		<a href="plugin.php?id=xunku_editor_spider:index&action=later&fid={$fid}">{$_G['setting']['navs'][6]['navname']}</a> <em>&rsaquo;</em>
		<a href="plugin.php?id=xunku_editor_spider:index&action=later&fid={$fid}">{lang xunku_editor_spider:editor_nav_title}</a> <em>&rsaquo;</em>{lang xunku_editor_spider:editor_btn_later}
	</div>
</div>
<form id="f_link" action="plugin.php?id=xunku_editor_spider:index&action=task" method="post" >
<input type="hidden" name="fid" value="{$fid}" />
<div class="exfm cl">
	<div class="sinf sppoll z">
		<div class="cl">
			<h4>{lang xunku_editor_spider:editor_add_tip_title}</h4>
		</div>
		<div id="pollm_c_1" class="mbm"><span id="url_new"></span>
			<p id="url_hidden" style="display: none">
				<label>1</label>
				<a href="javascript:;" class="d" onclick="delurl(this)">del</a>
				<input type="text"  class="px" autocomplete="off" style="width:340px;" tabindex="1">
				<input type="radio"  value="0" checked="checked"/>{lang xunku_editor_spider:editor_link_type_text1}
				<input type="radio"  value="1"/>{lang xunku_editor_spider:editor_link_type_text2}
			</p>
			<p><a href="javascript:;" onclick="addurl()">{lang xunku_editor_spider:editor_link_add_item}</a></p>
		</div>
		
		<div>
			<button type="submit" name="ajaxSubmit_btn" id="ajaxSubmit_btn" class="pn" value="true"><em>{lang xunku_editor_spider:submit_text}</em></button>
			<button type="button" name="goback" id="btn_goBack" class="pn"><em>{lang xunku_editor_spider:editor_add_return_post}</em></button>
		</div>
	</div>
	<div class="sadd z">
			<br/>
			<p class="mbn">{lang xunku_editor_spider:editor_add_right_desc1}<img src="static/image/common/faq.gif" alt="Tip" class="vm" style="margin: 0;" onmouseover="showTip(this)" tip="{lang xunku_editor_spider:editor_add_right_desc1_tip}" id="tip_0.8166665972676128" initialized="true"></p>
			<p class="mbn">{lang xunku_editor_spider:editor_add_right_desc2}<img src="static/image/common/faq.gif" alt="Tip" class="vm" style="margin: 0;" onmouseover="showTip(this)" tip="{lang xunku_editor_spider:editor_add_right_desc2_tip}" id="tip_0.816666597267622" initialized="true"></p>
			
		
	</div>

</div>

</form>
<script src="source/plugin/xunku_editor_spider/resource/js/jquery.min.js"></script>
<script src="source/plugin/xunku_editor_spider/resource/js/jquery.validate.min.js"></script>
<script>
var jQ = jQuery.noConflict();
var fid = '{$fid}';
if (fid) {
	fid = parseInt(fid);
}
jQ(function(){
	jQ("#f_link").validate({
			errorElement:"span",
			errorPlacement:function(error, element){
				error.css({color:"#f00",float:"none"});
				element.after(error);
			},
			focusout:true,
			ignore:false
		});

	jQ.validator.messages = {
			url:"{lang xunku_editor_spider:editor_input_not_url}",
			required:"{lang xunku_editor_spider:editor_input_not_null}",
		}
});
jQ('#btn_goBack').bind('click', function() {
	window.location.href ='forum.php?mod=post&action=newthread&fid='+fid;	
});

function addurl() {
	var count = jQ('input[type="text"]').length - 1;
	if(count <= maxoptions) {
		var clonerow = jQ('<p>' + jQ('#url_hidden').html() + '</p>');
		clonerow.find('label').html(curoptions+1);
		clonerow.find('input[type="text"]').attr('name', 'fetchUrl['+curoptions+']');
		clonerow.find('input[type="text"]').addClass('required url');
		clonerow.find('input[type="radio"]').attr('name', 'type['+curoptions+']');
		jQ('#url_hidden').before(clonerow);
		curoptions++;
	} else {
		jQ('#url_new').html('<span style="color:red">{lang xunku_editor_spider:editor_link_num_max_tip}'+maxoptions+'</span>');
		jQ("#url_new").fadeIn("slow");
		jQ("#url_new").fadeOut(4000);
	}
}

function delurl(obj) {
	obj.parentNode.parentNode.removeChild(obj.parentNode);
}
var maxoptions = parseInt('20');
var curoptions = 0;
addurl();
addurl();
addurl();
</script>
{subtemplate common/footer}